\hypertarget{class_state_machine_controller}{
\section{StateMachineController Class Reference}
\label{class_state_machine_controller}\index{StateMachineController@{StateMachineController}}
}


{\ttfamily \#include $<$StateMachineController.hpp$>$}

Inheritance diagram for StateMachineController:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_state_machine_controller}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_state_machine_controller_aa56cd02258869884cfc8d80ad68b89c2}{StateMachineController} (bool deactivateOnFinish=true)
\item 
virtual \hyperlink{class_state_machine_controller_a255a82d29b14a567f109a17a28f60f14}{$\sim$StateMachineController} ()
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{class_state_machine_controller_a90930632966aae4dee2833b251a25d60}{Initialize} ()
\item 
virtual void \hyperlink{class_state_machine_controller_ad70148f6adab45c120c08640798c70de}{ActivateImpl} ()
\item 
virtual void \hyperlink{class_state_machine_controller_a413b16c705e9da26c7c63dc34c7c132a}{Periodic} ()
\item 
virtual void \hyperlink{class_state_machine_controller_a4a6b3c6abc943be0aaf099a9a334cf66}{Continuous} ()
\item 
\hyperlink{class_state}{State} \& \hyperlink{class_state_machine_controller_ac7886d3b17056ccae8a3a11ac868d758}{GetInitialState} ()
\item 
void \hyperlink{class_state_machine_controller_ad226d02ed15b0369efb68f76583c36b0}{SetInitialState} (\hyperlink{class_state}{State} \&state)
\item 
\hyperlink{class_state}{State} \& \hyperlink{class_state_machine_controller_a49ced43862ab455ecdb34f239ac10333}{GetFinalState} ()
\item 
void \hyperlink{class_state_machine_controller_aef02e2493bf021aed334854dd71d69b0}{OwnState} (\hyperlink{class_state}{State} \&state)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \hyperlink{class_state_machine_controller}{StateMachineController} class uses a state machine system to control the robot.

To use it, create subclasses that override the Initialize. In Initialize, add the States and trasitions to those States.

This class seems to work. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_state_machine_controller_aa56cd02258869884cfc8d80ad68b89c2}{
\index{StateMachineController@{StateMachineController}!StateMachineController@{StateMachineController}}
\index{StateMachineController@{StateMachineController}!StateMachineController@{StateMachineController}}
\subsubsection[{StateMachineController}]{\setlength{\rightskip}{0pt plus 5cm}StateMachineController::StateMachineController (
\begin{DoxyParamCaption}
\item[{bool}]{deactivateOnFinish = {\ttfamily true}}
\end{DoxyParamCaption}
)}}
\label{class_state_machine_controller_aa56cd02258869884cfc8d80ad68b89c2}
Constructor for \hyperlink{class_state_machine_controller}{StateMachineController}. \hypertarget{class_state_machine_controller_a255a82d29b14a567f109a17a28f60f14}{
\index{StateMachineController@{StateMachineController}!$\sim$StateMachineController@{$\sim$StateMachineController}}
\index{$\sim$StateMachineController@{$\sim$StateMachineController}!StateMachineController@{StateMachineController}}
\subsubsection[{$\sim$StateMachineController}]{\setlength{\rightskip}{0pt plus 5cm}StateMachineController::$\sim$StateMachineController (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_state_machine_controller_a255a82d29b14a567f109a17a28f60f14}
Destructor for \hyperlink{class_state_machine_controller}{StateMachineController}. 

\subsection{Member Function Documentation}
\hypertarget{class_state_machine_controller_ad70148f6adab45c120c08640798c70de}{
\index{StateMachineController@{StateMachineController}!ActivateImpl@{ActivateImpl}}
\index{ActivateImpl@{ActivateImpl}!StateMachineController@{StateMachineController}}
\subsubsection[{ActivateImpl}]{\setlength{\rightskip}{0pt plus 5cm}void StateMachineController::ActivateImpl (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_machine_controller_ad70148f6adab45c120c08640798c70de}
Do not override this function.

Override Initialize instead. \hypertarget{class_state_machine_controller_a4a6b3c6abc943be0aaf099a9a334cf66}{
\index{StateMachineController@{StateMachineController}!Continuous@{Continuous}}
\index{Continuous@{Continuous}!StateMachineController@{StateMachineController}}
\subsubsection[{Continuous}]{\setlength{\rightskip}{0pt plus 5cm}void StateMachineController::Continuous (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_machine_controller_a4a6b3c6abc943be0aaf099a9a334cf66}
Overriders of this function should call this implimentation.

You can do this by calling \char`\"{}StateMachineController::Continuous\char`\"{}. \hypertarget{class_state_machine_controller_a49ced43862ab455ecdb34f239ac10333}{
\index{StateMachineController@{StateMachineController}!GetFinalState@{GetFinalState}}
\index{GetFinalState@{GetFinalState}!StateMachineController@{StateMachineController}}
\subsubsection[{GetFinalState}]{\setlength{\rightskip}{0pt plus 5cm}{\bf State} \& StateMachineController::GetFinalState (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_state_machine_controller_a49ced43862ab455ecdb34f239ac10333}
Gets the final \hyperlink{class_state}{State}.

When the final \hyperlink{class_state}{State} runs, the state machine is finished.

\begin{DoxyReturn}{Returns}
The final \hyperlink{class_state}{State}. 
\end{DoxyReturn}
\hypertarget{class_state_machine_controller_ac7886d3b17056ccae8a3a11ac868d758}{
\index{StateMachineController@{StateMachineController}!GetInitialState@{GetInitialState}}
\index{GetInitialState@{GetInitialState}!StateMachineController@{StateMachineController}}
\subsubsection[{GetInitialState}]{\setlength{\rightskip}{0pt plus 5cm}{\bf State} \& StateMachineController::GetInitialState (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_state_machine_controller_ac7886d3b17056ccae8a3a11ac868d758}
Gets the very first \hyperlink{class_state}{State} that runs.

\begin{DoxyReturn}{Returns}
The very first \hyperlink{class_state}{State} that runs. 
\end{DoxyReturn}
\hypertarget{class_state_machine_controller_a90930632966aae4dee2833b251a25d60}{
\index{StateMachineController@{StateMachineController}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!StateMachineController@{StateMachineController}}
\subsubsection[{Initialize}]{\setlength{\rightskip}{0pt plus 5cm}void StateMachineController::Initialize (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_machine_controller_a90930632966aae4dee2833b251a25d60}
Override this function to add the States and trasitions to those States. \hypertarget{class_state_machine_controller_aef02e2493bf021aed334854dd71d69b0}{
\index{StateMachineController@{StateMachineController}!OwnState@{OwnState}}
\index{OwnState@{OwnState}!StateMachineController@{StateMachineController}}
\subsubsection[{OwnState}]{\setlength{\rightskip}{0pt plus 5cm}void StateMachineController::OwnState (
\begin{DoxyParamCaption}
\item[{{\bf State} \&}]{state}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_state_machine_controller_aef02e2493bf021aed334854dd71d69b0}
Gives the \hyperlink{class_state_machine_controller}{StateMachineController} ownership of the specified \hyperlink{class_state}{State}, thereby relieving the user of the need to delete it.


\begin{DoxyParams}{Parameters}
{\em state} & The \hyperlink{class_state}{State} to be placed under owener of the \hyperlink{class_state_machine_controller}{StateMachineController}. Behaviour is only defined if the state is dynamically allocated (e.g. \char`\"{}new State()\char`\"{}). \\
\hline
\end{DoxyParams}
\hypertarget{class_state_machine_controller_a413b16c705e9da26c7c63dc34c7c132a}{
\index{StateMachineController@{StateMachineController}!Periodic@{Periodic}}
\index{Periodic@{Periodic}!StateMachineController@{StateMachineController}}
\subsubsection[{Periodic}]{\setlength{\rightskip}{0pt plus 5cm}void StateMachineController::Periodic (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_machine_controller_a413b16c705e9da26c7c63dc34c7c132a}
Overriders of this function should call this implimentation.

You can do this by calling \char`\"{}StateMachineController::Periodic\char`\"{}. \hypertarget{class_state_machine_controller_ad226d02ed15b0369efb68f76583c36b0}{
\index{StateMachineController@{StateMachineController}!SetInitialState@{SetInitialState}}
\index{SetInitialState@{SetInitialState}!StateMachineController@{StateMachineController}}
\subsubsection[{SetInitialState}]{\setlength{\rightskip}{0pt plus 5cm}void StateMachineController::SetInitialState (
\begin{DoxyParamCaption}
\item[{{\bf State} \&}]{state}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_state_machine_controller_ad226d02ed15b0369efb68f76583c36b0}
Sets the very first \hyperlink{class_state}{State} that runs.


\begin{DoxyParams}{Parameters}
{\em state} & The desired \hyperlink{class_state}{State} to run first. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
C:/Documents and Settings/Sam/My Documents/My Projects/Entech-\/Fpk/Entech-\/Fpk/StateMachineController.hpp\item 
C:/Documents and Settings/Sam/My Documents/My Projects/Entech-\/Fpk/Entech-\/Fpk/StateMachineController.cpp\end{DoxyCompactItemize}
